package com.mxpio.erp.common.plan.entity;

import com.mxpio.erp.common.jpa.model.BizOrder;
import com.mxpioframework.security.annotation.Dict;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.util.List;

/**
 * @Author : wpp
 * @Datetime : 2023/4/10 9:43
 * @Desc :
 * @Modor :  Modifytime:
 * @modDesc : 销售预测主表
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PLAN_SP")
@Schema(description="销售预测")
public class SalePrediction extends BizOrder {


    @Column(name = "PREDICTION_TYPE_")
    @Schema(description = "预测类型")
    @Dict(dicCode = "ERP_SALES_PREDICTION_TYPE")
    private String predictionType;

    @Column(name = "PREDICTION_ORG_")
    @Schema(description = "预测组织")
    private String predictionOrg;

    @Column(name = "APPLY_MAN_")
    @Schema(description = "申请人")
    private String applyMan;

    @Column(name = "APPLY_DEPT_")
    @Schema(description = "申请部门")
    private String applyDept;

    @Column(name = "MEMO_")
    @Schema(description = "预测说明(备注)")
    private String memo;

    @Transient
    @Schema(description = "销售预测明细行")
    private List<SalePredictionLine> salePredictionLines;

    @Override
    public String initTypeCode() {
        return "SP1";
    }
}
